Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restore: remove restore meta sql in create table #27199

Merged
merged 14 commits into from
Aug 30, 2021

Conversation

YuJuncen
Copy link
Contributor

@YuJuncen YuJuncen commented Aug 13, 2021

What problem does this PR solve?

Speed up create tables via omit a DDL job.

Problem Summary:

What is changed and how it works?

What's Changed: Remove all DDLs of rebasing autos.

How it Works: When creating table with CreateTableWithInfo, TiDB has rebased the auto ids via the table info:

tidb/ddl/ddl_api.go

Lines 1924 to 1937 in a9cba7c

if tbInfo.AutoIncID > 1 {
// Default tableAutoIncID base is 0.
// If the first ID is expected to greater than 1, we need to do rebase.
newEnd := tbInfo.AutoIncID - 1
if err = d.handleAutoIncID(tbInfo, schema.ID, newEnd, autoid.RowIDAllocType); err != nil {
return errors.Trace(err)
}
}
if tbInfo.AutoRandID > 1 {
// Default tableAutoRandID base is 0.
// If the first ID is expected to greater than 1, we need to do rebase.
newEnd := tbInfo.AutoRandID - 1
err = d.handleAutoIncID(tbInfo, schema.ID, newEnd, autoid.AutoRandomType)
}

It's no meaning for rebasing the auto ids again.

Check List

Tests

  • Integration test (at br_views_and_sequences)

Release note

Merged the rebase auto id operation into create table.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 13, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • 3pointer
  • kennytm

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 13, 2021
@YuJuncen
Copy link
Contributor Author

/component br
/cc 3pointer
/cc kennytm

@ti-chi-bot ti-chi-bot added the component/br This issue is related to BR of TiDB. label Aug 13, 2021
@YuJuncen
Copy link
Contributor Author

/run-integration-tests

@YuJuncen
Copy link
Contributor Author

/run-check_dev_2

@YuJuncen
Copy link
Contributor Author

/component br

@YuJuncen
Copy link
Contributor Author

/run-check_dev_2

@YuJuncen
Copy link
Contributor Author

/run-check_dev_2

@YuJuncen
Copy link
Contributor Author

/run-integration-tests

Copy link
Contributor

@kennytm kennytm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest LGTM

br/tests/br_views_and_sequences/run.sh Outdated Show resolved Hide resolved
br/tests/br_views_and_sequences/run.sh Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 17, 2021
@ti-chi-bot ti-chi-bot removed the status/LGT1 Indicates that a PR has LGTM 1. label Aug 30, 2021
@ti-chi-bot ti-chi-bot added the status/LGT2 Indicates that a PR has LGTM 2. label Aug 30, 2021
@YuJuncen
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 87dc81a

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 30, 2021
@ti-chi-bot
Copy link
Member

@YuJuncen: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@kennytm
Copy link
Contributor

kennytm commented Aug 30, 2021

/run-check_dev_2

[2021-08-30T06:12:03.525Z] The following test cases take too long to finish:

[2021-08-30T06:12:03.525Z] --- PASS: TestIndexRangeForUnsignedAndOverflow (5.09s)

[2021-08-30T06:12:03.525Z] --- PASS: TestIndexRangeEliminatedProjection (5.21s)

[2021-08-30T06:12:03.525Z] --- PASS: TestPrefixIndexRangeScan (5.21s)

[2021-08-30T06:12:03.526Z] --- PASS: TestTableRange (5.21s)

[2021-08-30T06:12:03.526Z] --- PASS: TestCompIndexMultiColDNF1 (5.21s)

[2021-08-30T06:12:03.526Z] --- PASS: TestPrefixIndexMultiColDNF (5.21s)

[2021-08-30T06:12:03.526Z] --- PASS: TestIndexRangeForBit (5.21s)

[2021-08-30T06:12:03.526Z] --- PASS: TestPrefixIndexAppendPointRanges (5.21s)

[2021-08-30T06:12:03.526Z] --- PASS: TestCompIndexDNFMatch (5.21s)

[2021-08-30T06:12:03.526Z] --- PASS: TestIndexStringIsTrueRange (5.21s)

[2021-08-30T06:12:03.526Z] --- PASS: TestIndexRangeForYear (5.21s)

[2021-08-30T06:12:03.526Z] --- PASS: TestIndexRangeForDecimal (5.21s)

[2021-08-30T06:12:03.526Z] --- PASS: TestIndexRange (5.21s)

[2021-08-30T06:12:03.526Z] --- PASS: TestCompIndexMultiColDNF2 (6.34s)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/br This issue is related to BR of TiDB. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants